package com.cennavi.buss.service.imp;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cennavi.buss.service.LayerService;
import com.cennavi.minemap.bean.MessageBean;

@FeignClient(value = "solu-service", fallback = LayerService.class)
public interface ILayerService {
    @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/layer/add")
    public MessageBean insert(@RequestBody String json);

    @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/layer/update")
    public MessageBean update(@RequestBody String json);

    @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/layer/update/{field}")
    public MessageBean updateStyle(@PathVariable(value = "field") String field, @RequestBody String json);

    @RequestMapping(method = RequestMethod.GET, value = "/service/layer/delete/{id}")
    public MessageBean delete(@PathVariable(value = "id") String id);

    @RequestMapping(method = RequestMethod.GET, value = "/service/layer/{id}")
    public MessageBean queryById(@PathVariable(value = "id") String id);

    @RequestMapping(method = RequestMethod.GET, value = "/service/layer/list/{soluId}")
    public @ResponseBody MessageBean queryBySoluId(@PathVariable(value = "soluId") int soluId);

    @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/layer/sort/{soluId}")
    public @ResponseBody MessageBean sort(@RequestBody String json, @PathVariable(value = "soluId") int soluId);

    @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/layer/group/update")
    public @ResponseBody MessageBean updateGroup(@RequestBody String json);

    @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/layer/visibility")
    public @ResponseBody MessageBean updateVisibility(@RequestBody String json);

    @RequestMapping(method = RequestMethod.GET, value = "/service/layer/prefix/byCode/{code}")
    public MessageBean queryLayerPerfixTreeByCode(@PathVariable(value = "code") String code);

    @RequestMapping(method = RequestMethod.GET, value = "/service/layer/prefix/getTree/{father}")
    public MessageBean queryLayerPerfixTreeByFather(@PathVariable(value = "father") String father);

    // @RequestMapping(method = RequestMethod.POST, consumes =
    // "application/x-www-form-urldecoded", value =
    // "/service/layer/batch/update/layout")
    // public @ResponseBody MessageBean updateLayersLayout(@RequestBody String
    // json);

    // @RequestMapping(method = RequestMethod.POST, consumes =
    // "application/x-www-form-urldecoded", value =
    // "/service/layer/batch/update/paint")
    // public @ResponseBody MessageBean updateLayersPaint(@RequestBody String
    // json);

    @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/layer/batch/update/{field}")
    public @ResponseBody MessageBean updateLayersStyle(@PathVariable(value = "field") String field, @RequestBody String json);

    @RequestMapping(method = RequestMethod.POST, consumes = "application/x-www-form-urldecoded", value = "/service/layer/prefix/update")
    public @ResponseBody MessageBean updateLayersPrefix(@RequestBody String json);
}
